<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class akuntansi extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('mtransaksi_jual');
    }

    public function index() {
        $data['title'] = 'Akuntansi';
        $data['page'] = 'public/retail/vakuntansi';
        $transaksi = $this->mtransaksi_jual->get_chart_per_tanggal(date('m'), date('Y'));
        $bln = "";
        $total = "";
        foreach ($transaksi->result() as $row) {
//            if(){
//                
//            }
            $bln = $bln . "','" . $row->tglbln;
            $total = $total . ',' . $row->total;
        }
        $bln = substr($bln, 2)."'";
        $total = substr($total, 1);
        $data['bulan'] = $bln;
        $data['tahun'] = date('Y');
        $data['total'] = $total;
        $this->load->view('public/retail/index', $data);
    }

}

/* End of file akuntansi.php */
/* Location: ./application/controllers/akuntansi.php */